using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Storage;
using SolanumSolstice_Windows.Mapping;
using SolanumSolstice_Windows.Buildings;

namespace SolanumSolstice_Windows.Units
{
    public class Survivalist : Subsister
    {
        public Survivalist(ContentManager content, Vector2 position)
            : base(content, position)
        {
            //basically same attributes as Civilian, "compared to" represents parent class's values

            texture = content.Load<Texture2D>("Content\\Txtr\\Units\\Sprites\\civ_survivalist_sheet");
            hudTexture = content.Load<Texture2D>("Content\\Txtr\\Units\\HUD\\civHUD");
            this.hitPoints = 20;  //compared to 15
            maxHitPoints = hitPoints;
            velocity = 1.5f;
            sightRadius = 3;
            attackPower = 2;  //compared to 1.5
            unitClass = UnitClass.Civilian;
            isGathering = false;
            isRepairing = false;
            isDepositing = false;
            GatherTime = 10;
            maxCarry = 4;

            repairPower = 9;
            repairTime = 2;

            spawnCost = 32;  //compared to 16
            timeCost = 24;   //compared to 16

        }

        public override Object Clone()
        {
            Survivalist u = new Survivalist(this.content, this.position);

            u.weapon = this.weapon;
            u.hitPoints = this.hitPoints;
            u.maxHitPoints = this.maxHitPoints;
            u.recoveryTime = this.recoveryTime;
            u.initialRecoveryTime = this.initialRecoveryTime;
            u.position = this.position;
            u.velocity = this.velocity;
            u.sightRadius = this.sightRadius;
            u.attackRadius = this.attackRadius;
            u.attackPower = this.attackPower;
            u.isSelected = this.isSelected;
            u.isDead = this.isDead;
            u.isDying = this.isDying;
            u.isZombie = this.isZombie;
            u.inBuilding = this.inBuilding;
            u.isAttacking = this.isAttacking;
            u.actionSelected = this.actionSelected;
            u.actionReady = this.actionReady;
            u.rand = this.rand;
            u.actions = this.actions;
            u.currentActionIndex = this.currentActionIndex;
            u.targetReached = this.targetReached;
            u.direction = new Vector2(this.direction.X, this.direction.Y);
            u.unitClass = this.unitClass;
            u.timeCost = this.timeCost;
            u.spawnCost = this.spawnCost;

            u.woodHolding = this.woodHolding;
            u.foodHolding = this.foodHolding;
            u.targetGatherBuilding = this.targetGatherBuilding;
            u.targetDepositBuilding = this.targetDepositBuilding;
            u.targetRoadBlock = this.targetRoadBlock;
            u.isGathering = this.isGathering;
            u.isRepairing = this.isRepairing;
            u.isDepositing = this.isDepositing;
            u.gatherTime = this.gatherTime;
            u.maxCarry = this.maxCarry;
            u.repairPower = this.repairPower;
            u.repairTime = this.repairTime;
            /*u.texture = content.Load<Texture2D>("Content\\Txtr\\Units\\Sprites\\civ_civilian_sheet");
            u.hudTexture = content.Load<Texture2D>("Content\\Txtr\\Units\\HUD\\copHUD");
            u.selectedCircle = content.Load<Texture2D>("Content\\Txtr\\Units\\selectedUnitCircle");
            u.emptyBar = content.Load<Texture2D>("Content\\Txtr\\Units\\EmptyBar");
            u.fullBar = content.Load<Texture2D>("Content\\Txtr\\Units\\FullBarWhite");*/
            u.frameCount = this.frameCount;
            u.frameIncrementer = this.frameIncrementer;
            u.weaponFrameCount = this.weaponFrameCount;
            u.dyingFrameCount = this.dyingFrameCount;
            u.groupOffset = new Vector2(this.groupOffset.X, this.groupOffset.Y);

            return (Object)u;
        }
    }

}